<?php
	session_start();
	if (!isset($_SESSION['kiemtradangnhapthinguyet']) || $_SESSION['kiemtradangnhapthinguyet']!=1) {
		header('location: ../../index.php');
		die;
	}
	$username = $_GET['username'];
	
	if ($username!="") {
		if (strlen($username)>5) {
			require("../librarys/funs/quantri.php");
			$class_user = new user;
			
			$record = $class_user->get_by_username($username);
		
			if($record != ""){
				echo '<font color="#FF0000">Username is use.</font>';
			}else{
				echo '<font color="#7BB805">You can use this username.</font>';
			}
		}else {
			echo '<font color=#FF0000"">Username must contain at least 6 characters.</font>';
		}
	}else{
		echo "";
	}
?>